package com.googlecode.ocl2sqlcompiler;

/**
 * @author Renato Miceli
 */
public enum OCLType {

	STRING(String.class), BOOLEAN(Boolean.class), INTEGER(Integer.class), REAL(
			Double.class), COLLECTION(Void.class), MODEL(Void.class);

	public final Class<?> javaType;

	private <T> OCLType(Class<T> clazz) {
		this.javaType = clazz;
	}

	public String toSQLType() {
		switch (this) {
		case STRING:
			return "VARCHAR(100)";
		case BOOLEAN:
			return "CHAR(1)";
		case INTEGER:
		case REAL:
			return "NUMBER";
		default:
			return null;
		}
	}

}
